package com.fmx.BookStore.domain;

import com.fmx.BookStore.core.domain.BaseEntity;
import org.springframework.stereotype.Component;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

@Component
public class Sale extends BaseEntity {
    //主键
    private Long saleId;
    //总数
    private BigDecimal total;
    //状态
    private String status;
    //订单编号
    private String saleNo;
    //销售时间
    private Date saleTime;
    //删除标志
    private String delFlag;
    //支付ID
    private Long paymentId;
    //订单明细
    private List<SaleItem> saleItems = new ArrayList<>();
    //支付
    private Payment payment;

    public Sale() {
    }

    public Sale(Long saleId, BigDecimal total, String status, String saleNo, Date saleTime, String delFlag, Long paymentId, List<SaleItem> saleItems, Payment payment) {
        this.saleId = saleId;
        this.total = total;
        this.status = status;
        this.saleNo = saleNo;
        this.saleTime = saleTime;
        this.delFlag = delFlag;
        this.paymentId = paymentId;
        this.saleItems = saleItems;
        this.payment = payment;
    }

    public Long getSaleId() {
        return saleId;
    }

    public void setSaleId(Long saleId) {
        this.saleId = saleId;
    }

    public BigDecimal getTotal() {
        return total;
    }

    public void setTotal(BigDecimal total) {
        this.total = total;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public String getSaleNo() {
        return saleNo;
    }

    public void setSaleNo(String saleNo) {
        this.saleNo = saleNo;
    }

    public Date getSaleTime() {
        return saleTime;
    }

    public void setSaleTime(Date saleTime) {
        this.saleTime = saleTime;
    }

    public String getDelFlag() {
        return delFlag;
    }

    public void setDelFlag(String delFlag) {
        this.delFlag = delFlag;
    }

    public Long getPaymentId() {
        return paymentId;
    }

    public void setPaymentId(Long paymentId) {
        this.paymentId = paymentId;
    }

    public List<SaleItem> getSaleItems() {
        return saleItems;
    }

    public void setSaleItems(List<SaleItem> saleItems) {
        this.saleItems = saleItems;
    }

    public Payment getPayment() {
        return payment;
    }

    public void setPayment(Payment payment) {
        this.payment = payment;
    }

    @Override
    public String toString() {
        return "Sale{" +
                "saleId=" + saleId +
                ", total=" + total +
                ", status='" + status + '\'' +
                ", saleNo='" + saleNo + '\'' +
                ", saleTime=" + saleTime +
                ", delFlag='" + delFlag + '\'' +
                ", paymentId=" + paymentId +
                ", saleItems=" + saleItems +
                ", payment=" + payment +
                '}';
    }
}
